# template elements
# presentation

R Workshop

Module 6: “To Infinity and Beyond” (2)

2018-04-18
Bobae Kang
(Bobae.Kang@illinois.gov)

Agenda

  • Part 1: Sharing your work
  • Part 2: Leveraging online resources

Why online resources?

  • We cannot know everything.
  • In fact, no one knows everything!
  • “Someone has already done it.” plot of chunk unnamed-chunk-1

    Source: AZ Quotes

Before going online

"The 15 minute rule"

  • First, try yourself. If you cannot solve it, then go online.

"Oops, my bad"

  • We all make typos. Check for typos!
    • RStudio does not check for typos automatically
    • But we can refer to an error caused by the typos
  • Check if a package is loaded before using its functions
    • Error in some_function() : could not find function "some_function"

Help function

# these are equivalent
?some_function
help(some_function)
  • Looking ino the documentation is often the best way to understand what a function is and how to use it.
  • Using the ? followed by the function name or help() brings out the documentation if available

Error messages and debugging

  • When an error is thrown, it comes with an error message
  • Error messages often have rich information about what went wrong and where it went wrong
  • If we are working with custom functions we defined, RStudio's debugging tools can help us to spot the source of an error in the script and debug it

Google

plot of chunk unnamed-chunk-4

Source: Google.com

How to google for questions

  • Be specific and succint
    • The search term should be a set of keywords
    • Using the relevant error message as a serach term can help

"Official" resources

plot of chunk unnamed-chunk-5

Source: R Project

CRAN

  • The Comprehensive R Archive Network (CRAN)
    • Manuals page
    • Task Views page
    • Packages page

Manuals

plot of chunk unnamed-chunk-6

Task Views

plot of chunk unnamed-chunk-7

Packages

  • Each contributed package that is listed on CRAN has a page
  • A reference manual and vignettes can be found on the CRAN package page
  • To directly get to the package page, try on your broswer:

plot of chunk unnamed-chunk-8

CRAN package page example (dplyr)

plot of chunk unnamed-chunk-9

Pacakge reference manuals

  • Packages have reference manuals that contain documentation for all its contents (i.e. functions and datasets)
    • Basically, it is a collection of help() documentations in a pdf format
  • Reference manual can also be found by googling
    • Try “package-name pdf” as your search term

Pacakge vignettes

  • Packages often have vignettes to introduce its contents
    • Some vignettes can be accessed via vignette("package") on console
    • Other vignettes are found on the pacakge page on CRAN
  • Unfortunately, not all packages have vignettes.

R Studio website

Cheet sheets

  • Currently, 13 RStudio cheat sheets are available, including:
    • “Data Transformation with dplyr”
    • “Data Import”
    • “Data Visualization with ggplot2”
    • “Date and times with lubridate”
    • “Work with strings with stringr”
  • Currently, there are 15 user-made cheat sheats as well
  • Some cheat sheats can also be found in RStudio IDE menu
    • “Help > Cheatsheets”

plot of chunk unnamed-chunk-12

Webinar & vidoes

Tidyverse website

R Markdown website

Shiny website

htmlwidgets website

Community support

plot of chunk unnamed-chunk-17

R-bloggers

Online "books"

R for Data Science

UC R Programming Guide

Notable websites

GitHub repositories

plot of chunk unnamed-chunk-20

Source: GitHub

What is GitHub?

“GitHub is a development platform inspired by the way you work. From open source to business, you can host and review code, manage projects, and build software alongside millions of other developers.” - GitHub.com

  • Most R packages are available as GitHub repositories, which can be “cloned” and downloaded if wanted.
  • Many R package authors offer brief explanations and even quick tutorials for their packages on the GitHub repositories.

Online courses

Popular sites

Datacamp

  • Requires registration and log-in
  • Some free courses are available, but most are paid courses with one free chapter
  • Cost is $25/month with the annual plan or $29/month
    • Onces subscribed, all courses become available
  • Offers 70+ courses on R
    • Each course is short (~4 hours) and focused on a specific topic
    • Ranging from basic to intermediate level

Coursera

  • Requires registration and log-in
  • You can “audit” the course for free
    • Certification for course completion and online support become available onces you purchase the course
  • Notable contents
    • Data Science Specialization (10 courses)
    • Statistics with R Specialization (5 courses)

edX

Udacity

Questions?

plot of chunk unnamed-chunk-22

Source:

References